<?php


namespace app\index\validate;


use think\Validate;

/**
 * Class RegisterValidate
 * @package app\index\validate
 *
name: "用户名"
name_repeat: "确认用户名"
password: "密码"
password_repeat: "确认密码"
email: "电子邮箱"
email_repeat: "确认电子邮箱"
vol_true_name: "真实姓名"
vol_cert_number: "证件号码"
gender: "0"
vol_reg_year: ""
vol_reg_month: ""
vol_reg_day: ""
vol_political: "政治面貌"
vol_ethnicity: "4788"
tel: "手机"
 */
class RegisterValidate extends Validate
{
    protected $rule = [
        'name' => 'require|min:6|max:20|confirm:name_repeat|unique:users',
        'password' => 'require|min:8|max:20|confirm:password_repeat',
        'email' =>'require|email|confirm:email_repeat|unique:users',
        'vol_true_name'=>'require',
        'vol_cert_number'=>'require|idCard',
        'vol_reg_year' => 'require',
        'vol_reg_month' =>'require',
        'vol_reg_day' => 'require',
        'tel'=>'require|mobile'
    ];

    protected $message = [
        'name.require' =>'用户名必须填写',
        'name.min' =>'用户名最小为6位',
        'name.max' =>'用户名最大为20位',
        'name.confirm' =>'用户名与确认用户名不一致',
        'name.unique'=>'该用户名已经注册过，请您更换用户名',
        'password.require' =>'密码必须填写',
        'password.min' =>'密码最小8位',
        'password.max' =>'密码必须小于20位',
        'password.confirm'=>'密码和确认密码不一致,请您检查',
        'email.require' => '邮箱必须填写',
        'email.email' => '邮箱格式不正确',
        'email.confirm' =>'邮箱与确认邮箱不一致',
        'email.unique' =>'该邮箱已经注册过,请您重新输入邮箱',
        'vol_true_name.require' =>'真实姓名必须填写',
        'vol_cert_number.require' => '身份证号必须填写',
        'vol_cert_number.idCard' =>'身份证号码格式错误',
        'vol_reg_year.require' =>'出生年份必须填写',
        'vol_reg_month.require' =>'出生月份必须填写',
        'vol_reg_day.require' =>'出生日期必须填写',
        'tel.require' =>'手机号必须填写',
        'tel.mobile' =>'手机号格式不正确',
    ];
}
